/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package warmachineroster.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;

import warmachineroster.Roster;
import warmachineroster.RosterElement;
import warmachineroster.UnitRosterElement;
import warmachineroster.WarcasterRosterElement;
import warmachineroster.WarjackRosterElement;
import warmachineroster.WarmachineRosterFactory;
import warmachineroster.WarmachineRosterPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class WarmachineRosterFactoryImpl extends EFactoryImpl implements WarmachineRosterFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static WarmachineRosterFactory init() {
		try {
			WarmachineRosterFactory theWarmachineRosterFactory = (WarmachineRosterFactory)EPackage.Registry.INSTANCE.getEFactory("http://warmachineroster/1.0"); 
			if (theWarmachineRosterFactory != null) {
				return theWarmachineRosterFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new WarmachineRosterFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public WarmachineRosterFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case WarmachineRosterPackage.ROSTER: return createRoster();
			case WarmachineRosterPackage.ROSTER_ELEMENT: return createRosterElement();
			case WarmachineRosterPackage.UNIT_ROSTER_ELEMENT: return createUnitRosterElement();
			case WarmachineRosterPackage.WARCASTER_ROSTER_ELEMENT: return createWarcasterRosterElement();
			case WarmachineRosterPackage.WARJACK_ROSTER_ELEMENT: return createWarjackRosterElement();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Roster createRoster() {
		RosterImpl roster = new RosterImpl();
		return roster;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RosterElement createRosterElement() {
		RosterElementImpl rosterElement = new RosterElementImpl();
		return rosterElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UnitRosterElement createUnitRosterElement() {
		UnitRosterElementImpl unitRosterElement = new UnitRosterElementImpl();
		return unitRosterElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public WarcasterRosterElement createWarcasterRosterElement() {
		WarcasterRosterElementImpl warcasterRosterElement = new WarcasterRosterElementImpl();
		return warcasterRosterElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public WarjackRosterElement createWarjackRosterElement() {
		WarjackRosterElementImpl warjackRosterElement = new WarjackRosterElementImpl();
		return warjackRosterElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public WarmachineRosterPackage getWarmachineRosterPackage() {
		return (WarmachineRosterPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static WarmachineRosterPackage getPackage() {
		return WarmachineRosterPackage.eINSTANCE;
	}

} //WarmachineRosterFactoryImpl
